<?php

namespace app\api\logic\page;

use app\common\repository\articleTag\R as ArticleTagRRepository;
use app\common\repository\book\R as BookRRepository;

class Home
{
    public function __construct(
        ArticleTagRRepository $articleTagRRepository,
        BookRRepository $bookRRepository
    )
    {
        $this->articleTagRRepository = $articleTagRRepository;
        $this->bookRRepository = $bookRRepository;
    }

    public function info()
    {
        $tag = $this->articleTagRRepository->getHotTags();
        $book = $this->bookRRepository->getHotBooks();
        return ['data' => ['tag' => $tag, 'book' => $book]];
    }
}
